import AddressIndex from '@/components/address/index.vue'
import AddressAdd from '@/components/address/add.vue'
import AddressEdit from '@/components/address/edit.vue'

//定义一个路由列表(子路由)
const list = [
    {
        name: 'AddressIndex',
        //生成路由地址：/address/index
        path: 'index',  
        component: AddressIndex,
        //登录状态验证
        meta:{login:true}
    },
    {
        name: 'AddressAdd',
        //生成路由地址：/address/add
        path: 'add',  
        component: AddressAdd,
        //登录状态验证
        meta:{login:true}
    },
    {
        name: 'AddressEdit',
        //生成路由地址：/address/edit
        path: 'edit',  
        component: AddressEdit,
        //登录状态验证
        meta:{login:true}
    },
]

//父级的组件模板
const layout = {
    template: `<router-view></router-view>`
}

export default [
    {
        name: 'address',
        path: '/address',
        component: layout,
        children: list
    }
]